﻿Imports SuporteDominio
Public Class AcessoDAO
    Implements IAcesso


    Private interDB As New InterfaceNet_DB.InterfaceNetSuporteEntities

    Public Function ListarAcessos(parDataInicio As Date, parDataFim As Date) As List(Of Acesso) Implements IAcesso.ListarAcessos
        interDB.Connection.Open()


        interDB.Connection.Close()
    End Function

    Public Function RegistrarAcesso(parPerfilPermissao As Integer, parDataAcesso As Date, parIpUsuario As String) As Boolean Implements IAcesso.RegistrarAcesso
        Dim result As Boolean = False
        Try
            interDB.Connection.Open()
            Dim acesso As New InterfaceNet_DB.ACESSO
            acesso.ACE_DATA_ACESSO = parDataAcesso
            acesso.ACE_IP_USUARIO = parIpUsuario
            acesso.PermissaoPerfil = New InterfaceNet_DB.PermissaoPerfil
            acesso.PermissaoPerfil.PERFIL = New InterfaceNet_DB.PERFIL
            acesso.PermissaoPerfil.PERFIL.PER_ID_PERFIL = 1
            acesso.PermissaoPerfil.USUARIO = New InterfaceNet_DB.USUARIO
            acesso.PermissaoPerfil.USUARIO.USU_ID_USUARIO = 1
            interDB.AddToACESSOes(acesso)
            interDB.SaveChanges()
            result = True
        Catch ex As Exception
        Finally
            interDB.Connection.Close()
        End Try
        Return result
    End Function

    Public Function ListarAcessos1(parDataInicio As Date, parDataFim As Date, parIdUsuario As Integer) As List(Of Acesso) Implements IAcesso.ListarAcessos
        interDB.Connection.Open()

        interDB.Connection.Close()
    End Function
End Class
